import strformat

proc recite*(words: seq[string]): string = 
  for i in 1 ..< words.len:
    var
      nail = words[i - 1]
      horse = words[i]
    result.add &"For want of a {nail} the {horse} was lost.\n"
  
  if words.len > 0:
    result.add &"And all for the want of a {words[0]}."